package com.utils;

import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * 创建下面的子类来创建出自己的下一页和上一页的算法
 * 插件的物理分页逻辑
 */
public class PageInfoEx<T> extends PageInfo<T> {
    private int previousPage;
    private int nextPageNo;

    public PageInfoEx(List<T> list) {
        super(list);
    }

    public int getPreviousPage() {
        return this.isIsFirstPage() == true ? 1 : this.getPrePage();
    }

    public int getNextPageNo() {
        return this.isHasNextPage() == true ? getNextPage() : this.getPages();
    }
}
